package o;

import android.content.Context;
import androidx.annotation.NonNull;
import com.huawei.gameassistant.buoysettingmodule.BuoyResult;
import com.huawei.hmf.orb.exception.ConnectRemoteException;
import o.eyc.e;

public class bgj {

    static class b implements o.fho.b {
        private b() {
        }

        public void ˏ(ffd o_ffd, ConnectRemoteException connectRemoteException) {
        }
    }

    public void ˊ(@NonNull Context context) {
        if (context == null) {
            Logger.e("GameModeProxy", "call [close] exception, context is null");
        }
        final ffa o_ffp = new ffp(context, "com.huawei.gameassistant");
        fho.ˋ(o_ffp, new b(this) {
            final /* synthetic */ bgj ˏ;

            public void ˏ(ffd o_ffd, ConnectRemoteException connectRemoteException) {
                if (connectRemoteException != null) {
                    Logger.e("GameModeProxy", "connect com.huawei.gameassistant exception");
                    return;
                }
                fhz ˋ = o_ffd.ˋ("buoysettingmodule");
                if (ˋ == null) {
                    Logger.e("GameModeProxy", "Module buoysettingmodule is null");
                    return;
                }
                eyb o_eyb = (eyb) ˋ.ॱ(eyb.class);
                if (o_eyb == null) {
                    Logger.e("GameModeProxy", "buoyWindowManager is null");
                    return;
                }
                o_eyb.ॱॱ();
                o_ffp.ॱ();
            }
        });
    }

    private void ˏ(Context context, BuoyResult buoyResult) {
        if (context == null || buoyResult == null) {
            Logger.e("GameModeProxy", "disposeBuoyResult param is invalid");
            return;
        }
        if (Logger.ˎ()) {
            Logger.ˏ("GameModeProxy", "the result from BuoyModeSettingWindow is " + buoyResult.ˊ());
        }
        int ˊ = buoyResult.ˊ();
        if (ˊ == e.ˏ.intValue()) {
            fam.ॱ().ˋ(context);
        } else if (ˊ == e.ॱ.intValue()) {
            fam.ॱ().ˎ(context);
            fam.ॱ().ˎ();
        } else if (ˊ == e.ʻ.intValue()) {
            fam.ॱ().ˊ();
        }
    }

    public void ˏ(@NonNull Context context) {
        ffa o_ffp = new ffp(context, "com.huawei.gameassistant");
        fho.ˋ(o_ffp, new 3(this, context, o_ffp));
    }

    public void ˎ(@NonNull Context context) {
        ffa o_ffp = new ffp(context, "com.huawei.gameassistant");
        fho.ˋ(o_ffp, new 2(this, context, o_ffp));
    }

    public void ˊ(@NonNull Context context, String str) {
        ffa o_ffp = new ffp(context, "com.huawei.gameassistant");
        fho.ˋ(o_ffp, new 5(this, str, context, o_ffp));
    }

    public void ˎ(@NonNull Context context, String str) {
        ffa o_ffp = new ffp(context, "com.huawei.gameassistant");
        fho.ˋ(o_ffp, new 1(this, str, context, o_ffp));
    }
}
